#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .. import command
from utility.odoo_manager import OdooManager

"""查询字典"""
def get_dict_value(k,type):
    try:
        odoo = OdooManager().get_instance()
        query_ = [
                ('key', '=', k),
                ('name', '=', type)
            ] 
        value_ = odoo.env['dict.dictionary'].search_read(query_)
        return value_[0]['value']
    except Exception as e:
        print(e)
        pass    


